package com.kerwin.utils;

/**
 * @Author: kerwin
 * @CreateTime: 2023-02-18  16:32
 */
public class ApiResult<T> {

    private Integer code;
    private T data;
    private String msg;

    public ApiResult(Integer code, T data, String msg) {
        this.code = code;
        this.data = data;
        this.msg = msg;
    }

    public static <T> ApiResult<T> ok(T data){
        return new ApiResult(200,data,"成功！");
    }

    public static <T> ApiResult<T> ok(){
        return new ApiResult(200,null,"成功！");
    }
}
